﻿using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using easyccms.BusinessLayer.Entities;
using easyccms.BusinessLayer.Repositories;
using easyccms.WebUI.Infrastructure;

namespace easyccms.WebUI.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        /// <summary>
        /// Gets the menu repository.
        /// </summary>
        private IMenuRepository MenuRepository
        {
            get { return DependencyInjector.Resolve<IMenuRepository>(); }
        }
        
 

        public ActionResult Index()
        {
            var submenuName = string.Empty;



            IList<MenuItem> items = this.MenuRepository.Load(1).MenuItems.ToList();

            ViewData["Message"] = "Welcome to ASP.NET MVC!" + submenuName + items[0].Name;


            
            return View();
        }

        
  
        public ActionResult About()
        {
            return View();
        }
    }

 
}
